package com.zxy.ziems.server.alarm.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * @Copyright (C),
 * @ClassName: AlarmTypeParamEnum
 * @Author: yanzhiwei
 * @Description:
 * @Date: 2024/5/16 23:20
 */
public enum AlarmTypeParamEnum {
    FIRE(new ArrayList<>() {{
        add("Fire");
        add("FireDetector");
    }}, "2"),
    GAS(new ArrayList<>() {{
        add("GasDetector");
    }}, "1"),
    ;
    private List<String> code;

    private String value;

    AlarmTypeParamEnum(List<String> code, String value) {
        this.code = code;
        this.value = value;
    }

    public List<String> getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static List<String> getCodeByValue(String value) {
        for (AlarmTypeParamEnum alarmTypeEnum : values()) {
            if (alarmTypeEnum.getValue().equals(value)) {
                return alarmTypeEnum.getCode();
            }
        }
        return null;
    }


}
